Skip to content

scp: add flag to notify for uploading finished when uploaded an empty file #1658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

thegame4craft
Copy link
Contributor

Added a new flag: notifyOnEmptyFile (default: false).

Details
* This flag controls whether the Uploading event should be triggered when an uploaded file is empty (totalLength == 0).
* When enabled and the uploaded file is empty, the Uploading event will still be raised.
* This behavior is currently implemented only for SCP uploads.

Use Case
I’m building a simple .NET Framework application that uploads configuration files to an SSH server. Each upload triggers a log entry via the Uploading event. However, empty files were previously ignored, and no log was written. With this change, the log will accurately reflect all upload attempts — including empty files — when the flag is enabled.

Copy link
Collaborator

@Rob-Hague Rob-Hague left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@Rob-Hague Rob-Hague merged commit 6bb3978 into sshnet:develop Jun 20, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants